<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

		<title>地址管理</title>

		<link href="/static/user/AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
		<link href="/static/user/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css">

		<link href="/static/user/css/personal.css" rel="stylesheet" type="text/css">
		<link href="/static/user/css/addstyle.css" rel="stylesheet" type="text/css">
		<script src="/static/user/AmazeUI-2.4.2/assets/js/jquery.min.js" type="text/javascript"></script>
		<script src="/static/user/AmazeUI-2.4.2/assets/js/amazeui.js"></script>
		<script src="/static/user/js/personal/address.js"></script>

	</head>

	<body>
		<!--头 -->
		<header>
			<article>
				<div class="mt-logo">
					<!--顶部导航条 -->
					<div class="am-container header">
						<ul class="message-r">
							<div class="topMessage home">
								<div class="menu-hd"><a href="/" target="_top" class="h">商城首页</a></div>
							</div>
							<div class="topMessage my-shangcheng">
								<div class="menu-hd MyShangcheng"><a href="/person" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a></div>
							</div>
							<div class="topMessage mini-cart">
								<div class="menu-hd"><a id="mc-menu-hd" href="#" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h">0</strong></a></div>
							</div>
							<div class="topMessage favorite">
								<div class="menu-hd"><a href="/user/user/logout" target="_top"><i class="am-icon-power-off am-icon-fw"></i><span>退出</span></a></div>
							</div>
							</ul>
						</div>

						<!--悬浮搜索框-->

						<div class="nav white">
							<div class="logoBig">
								<a href="/"><img src="/static/user/images/guangonglogo.jpg"/></a>
							</div>

							<div class="search-bar pr">
								<a name="index_none_header_sysc" href="#"></a>
								<form action="/user/index/search" method="GET">
									<input id="searchInput" name="name" type="text" placeholder="搜索" autocomplete="off">
									<input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
								</form>
							</div>
						</div>

						<div class="clear"></div>
					</div>
				</div>
			</article>
		</header>

		<b class="line"></b>

		<div class="center">
			<div class="col-main">
				<div class="main-wrap">

					<div class="user-address">
						<!--标题 -->
						<div class="am-cf am-padding">
							<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">地址管理</strong> / <small>Address&nbsp;list</small></div>
						</div>
						<hr/>
						<ul class="am-avg-sm-1 am-avg-md-3 am-thumbnails">

							{volist name='addresslist' id='obj'}
								{if $obj.is_default == 1}
									<li class="user-addresslist defaultAddr">
										<input type="text" id="default" value="{$obj.id}" style="display: none;">
										<span class="new-option-r"><i class="am-icon-check-circle"></i>默认地址</span>
										<p class="new-tit new-p-re">
											<span class="new-txt">{$obj.receiver}</span>
											<span class="new-txt-rd2">{$obj.phone}</span>
										</p>
										<div class="new-mu_l2a new-p-re">
											<p class="new-mu_l2cw">
												<span class="title">地址：</span>
												<span class="street">{$obj.address}</span>
											</p>
										</div>
										<div class="new-addr-btn">
											<a href="javascript:void(0);" onclick="delClick({$obj.id});"><i class="am-icon-trash"></i>删除</a>
										</div>
									</li>
								{/if}
							{/volist}

							{volist name='addresslist' id='obj'}
								{if $obj.is_default != 1}
									<li class="user-addresslist">
										<span class="new-option-r" onclick="setdefault({$obj.id})"><i class="am-icon-check-circle"></i>设为默认</span>
										<p class="new-tit new-p-re">
											<span class="new-txt">{$obj.receiver}</span>
											<span class="new-txt-rd2">{$obj.phone}</span>
										</p>
										<div class="new-mu_l2a new-p-re">
											<p class="new-mu_l2cw">
												<span class="title">地址：</span>
												<span class="street">{$obj.address}</span>
											</p>
										</div>
										<div class="new-addr-btn">
											<a href="javascript:void(0);" onclick="delClick({$obj.id});"><i class="am-icon-trash"></i>删除</a>
										</div>
									</li>
								{/if}
							{/volist}
						</ul>
						<div class="clear"></div>
						<a class="new-abtn-type" data-am-modal="{target: '#doc-modal-1', closeViaDimmer: 0}">添加新地址</a>
						<!--例子-->
						<div class="am-modal am-modal-no-btn" id="doc-modal-1">

							<div class="add-dress">

								<!--标题 -->
								<div class="am-cf am-padding">
									<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">新增地址</strong> / <small>Add&nbsp;address</small></div>
								</div>
								<hr/>

								<div class="am-u-md-12 am-u-lg-8" style="margin-top: 20px;">
									<form action="/user/Person/newaddress" method="post" class="am-form am-form-horizontal">

										<div class="am-form-group">
											<label for="user-name" class="am-form-label">收货人</label>
											<div class="am-form-content">
												<input type="text" name="receiver" id="user-name" placeholder="收货人">
											</div>
										</div>

										<div class="am-form-group">
											<label for="user-phone" class="am-form-label">手机号码</label>
											<div class="am-form-content">
												<input id="user-phone" name="phone" placeholder="手机号必填" type="text">
											</div>
										</div>

										<div class="am-form-group">
											<label for="user-intro" class="am-form-label">详细地址</label>
											<div class="am-form-content">
												<textarea class="" rows="3" name="address" id="user-intro" placeholder="输入详细地址"></textarea>
												<small>100字以内写出你的详细地址...</small>
											</div>
										</div>

										<div class="am-form-group">
											<div class="am-u-sm-9 am-u-sm-push-3">
												<input type="submit"  value="保存" class="am-btn am-btn-danger">
											</div>
										</div>
									</form>
								</div>

							</div>

						</div>

					</div>

					<script type="text/javascript">
						$(document).ready(function() {							
							$(".new-option-r").click(function() {
								$(this).parent('.user-addresslist').addClass("defaultAddr").siblings().removeClass("defaultAddr");
							});
							
							var $ww = $(window).width();
							if($ww>640) {
								$("#doc-modal-1").removeClass("am-modal am-modal-no-btn")
							}
							
						})
					</script>

					<div class="clear"></div>

				</div>
				<!--底部-->
				<div class="footer">
					<div class="footer-hd">
						<p>
							<a href="/">商城首页</a>
							<b>|</b>
							<a href="https://www.alipay.com/">支付宝</a>
							<b>|</b>
							<a href="https://www.kuaidi100.com/?from=openv">快递查询</a>
						</p>
					</div>
				</div>
			</div>

			<aside class="menu">
				<ul>
					<li class="person">
						<a href="/person">个人中心</a>
					</li>
					<li class="person">
						<a>个人资料</a>
						<ul>
							<li> <a href="/information">个人信息</a></li>
							<li> <a href="/safety">安全设置</a></li>
							<li class="active"> <a href="/address">收货地址</a></li>
						</ul>
					</li>
					<li class="person">
						<a>我的交易</a>
						<ul>
							<li><a href="/order?act1=1">订单管理</a></li>
						</ul>
					</li>


					<li class="person">
						<a>我的小窝</a>
						<ul>
							<li> <a href="/comment">评价</a></li>

						</ul>
					</li>

				</ul>

			</aside>
		</div>

	</body>

</html>